home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / fsp-2.7 / fsp-2 / fsp / vms_src / vmsmain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-19  |  726 b   |  33 lines

  1. #include <stdio.h>
  2.  
  3. int
  4. main(int argc,char **argv,char **envp)
  5. {
  6. char *arg,*here;
  7. int ac=1,count=1;    /* argument counts */
  8. char *av[255]; /* will go wrong when you have more than 255 arguments.. */
  9.  
  10. av[0]=argv[0]; /* 0th argument always name of command */
  11.  
  12. while (count<argc)
  13. {
  14.  arg=here=argv[count]; /* get the 1st argument */
  15.  
  16.  while (*here==' ') { arg++; here++; } /* string leading spaces */
  17.  
  18.  while (*here)
  19.  {
  20.   if ((*here)==' ') /* arguments separated with spaces */
  21.   { *here=0;      /* terminate this one */
  22.     av[ac++]=arg; /* add it to the new argument list */
  23.     arg=here+1;   /* hold the next arg. */
  24.   }
  25.   here++;
  26.  }
  27.  if (*arg) av[ac++]=arg; /* last of this argument */
  28.  count++;
  29. }
  30.  
  31. return(vms_main(ac,av,envp));
  32. }
  33.